package cn.tedu.boqi.shop.order.web;

import lombok.Data;

@Data
public class JsonResult<T> {
    private Integer serviceCode;
    private T data;
    public static JsonResult ok(){
        JsonResult result = new JsonResult();
        result.setServiceCode(ServiceCode.OK.value);
        return result;
    }
    public static <T> JsonResult<T> ok(T object){
        JsonResult<T> jsonResult = new JsonResult<>();
        jsonResult.setServiceCode(ServiceCode.OK.getValue());
        jsonResult.setData(object);
        return jsonResult;
    }
}
